﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Turtle8
{
    public partial class QueryTabPage : TabPage
    {
        SqlDataAdapter da;
        DataTable dt = new DataTable();
        public DataGridView DGV
        { get { return this.dataGridView; } }

        public QueryTabPage(string header, SqlCommand selectCmd)
        {
            InitializeComponent();
            this.ImageIndex = 0;
            this.Text = header;            

            //filling the dataGridView
            da = new SqlDataAdapter(selectCmd);
            selectCmd.Connection = CompanyManager.Connection;
            da.Fill(dt);
            dataGridView.DataSource = dt;

            CompanyManager.setTableColumnHeadersHebrew(dt.Columns);
        }

        


    }
}
